1. Field of the Invention
The invention relates to a method for the computer-aided generation of at least one part of an executable control program, particularly a measuring, control, regulating, and/or calibration program, for controlling a control system having at least one electronic processor unit, whereby the functionality of the control program is described at least partially in at least one graphical model and the graphical model is divided in hierarchical levels into submodels, whereby a submodel of a hierarchical level can be divided nested into submodels of a lower hierarchical level, whereby values for options for the compiling of the graphical model to program code are preset and with consideration of the values for the options, program code is generated computer-aided from the model and the program code is co-compiled to the executable control program.
2. Description of the Background Art
Methods for the computer-aided generation have been very common and established for several years in the development of control systems, because they enable secure and convenient automated code generation for mainly real-time-capable control systems (e.g., production code generation with TargetLink). Depending on the degree of complexity of the control systems, one or more, partially or also completely networked control devices, which typically have appropriate I/O interfaces, are often used as processor units to be able to measure metrologically state variables of a physical-technical system to be influenced, and to be able to influence the physical-technical system by outputting specific control variables.
The advantage of such methods is that the desired functionality of the control program can be modeled on an abstract level by means of a graphical model, for example, in the form of block diagrams, which allow the depiction of highly complicated mathematical and structural relationships in a very simple way. Even I/O functionalities can be depicted and modeled in such a graphical model. It is then basically possible by using the method in question to generate program code for the very specialized hardware of the electronic processor unit, which is compiled, therefore translated, to an executable control program and can be executed and tested on this specialized target hardware. The error-prone manual conversion of a control concept into program code and thus ultimately into the control program is obviated; as a result, the rapid development cycles typical today have now become possible, for example, within the scope of rapid control prototyping or hardware-in-the-loop simulation.
Graphical models, particularly in the form of block diagram, are especially suitable for dividing a functionality into different model parts. Model parts within or at a hierarchical level are complementary at this hierarchical level to form an overall graphical model, whereby these model parts, solely on the basis of the complexity of many graphical models, are handled by different developers or development teams. In the case of a vehicle, the model parts can be, for example, the models of a drive assembly, drive train, and vehicle structure, whereby each of these model parts can break down into further model parts, i.e., submodels.
Typically, a graphical model can be divided into model parts not only within or at a hierarchical level, therefore “horizontally” into complementary model parts. Rather, the graphical model of a hierarchical level or the submodels in this hierarchical level can each be divided into submodels or nested into submodels of a different hierarchical level, whereby the submodels in a lower hierarchical level depict the functionality of the overlying submodel of the next higher hierarchical level often only in a different level of detail. Nested submodels of a graphical model at different hierarchical levels are accordingly expanded “vertically” and show one and the same functionality in different detail. Submodels at different hierarchical levels are also suitable for being handled simultaneously collaboratively by different developers.
It can be easily understood that there are dependencies between the different parts or nested submodels of a graphical model; these relate to the generation of program code from parts or submodels of the graphical model and should be considered in the further compiling of program code to the executable control program.
EP 1 522 910 A1, which is incorporated herein by reference, for example, discloses a method for generating an executable control program, in which it is possible in a simple way to configure the configuration of mathematically abstract parts of the graphical model independent of hardware-dependent settings of the target hardware.
EP 2 330 469 A1, which corresponds to US 20110138353, and which is incorporated herein by reference, discloses another method for generating an executable control program for controlling a control system, in which conflict-free generation of program code is achieved by suitable referencing between data elements in a data element set and parts of the graphical model.
The invention presented below is based on the realization that the rendering of the graphical model into program code based on dependencies between submodels can be problematic, particularly when values for options for compiling the graphical model to program code are preset, which influence the compiling of program code to the executable control program, and these preset values are different, for example, in nested submodels. In this situation, the questions arise how to resolve possibly ambiguous option presets, which concern, for example, compiler instructions, how to avoid logically contradictory presets, and how to resolve possible cases of conflict.